#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"
#include "php_openal.h"

char openal_error_exists() {
	if(alGetError() != AL_NO_ERROR) {
		return 1;
	} else {
		return 0;
	}
}

void openal_init() {
	ALfloat pos[6] = { 0,0,0, 0,0,0 };

	alutInit(NULL,0);
	
	alListenerfv(AL_ORIENTATION, pos);
	alListener3f(AL_POSITION, pos[0], pos[1], pos[2]);
	alListener3f(AL_VELOCITY, pos[0], pos[1], pos[2]);
}

void openal_shutdown() {
	alutExit();
}
